<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>提现记录</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  
    {include file="public/css"}
    {include file="public/js"}
</head>
<body>

<!-- 后台面包屑导航 -->
{:get_admin_breadcrumb()}
<blockquote class="layui-elem-quote">审核成功的信息，只有超级管理员才可以删除</blockquote>
<!-- 搜索表单 -->
{:create_search_form("",$keywordsData,$customSingleField,$groupData,$dateData,$orderData)}

<div class="layui-form">
  <table class="layui-table" id="demo">
    <colgroup>
      <col width="50">
      <col width="120">
      <col width="70">
      <col width="70">
      <col width="120">
      <col width="290">
      <col width="100">
      <col width="100">
      <col width="100">
      <col width="100">
      <col width="120">
      <col width="350">
    </colgroup>
    <thead>

      <tr>
        <th><input type="checkbox"  id="selectAll"  lay-skin="primary" lay-filter="selectAll"></th>
        <th>流水号</th>
        <th>提现<br>金额</th>
        <th>手续费</th>
        <th>实际到帐</th>
        <th>开户信息</th>
        <th>申请用户名</th>
        <th>申请<br>时间</th>
        <th>受理<br>时间</th>
        <th>受理人</th>
        <th>状态</th>
        <th>操作</th>
      </tr> 
    </thead>
    <tbody>

{volist name='list' id='vo'}
      <tr>
        <td>{if $vo.status !=0 }<input type="checkbox" name="id[]" class="id " title=""  lay-skin="primary" value="{$vo.id}">{/if}</td>
        <td>{$vo.id}</td>
        <td><span class="orange">{$vo.amount|number_format="2"}</span></td>
        <td>{if $vo.fee > 0}{$vo.fee} % {else}免手续费{/if}</td>
        <td><span class="orange">{$vo.actual_account|number_format="2"}</span></td>
        <td>银行：{$vo.bankname} <br>支行：{$vo.branch} <br>卡号:{$vo.card_number} <br>姓名：{$vo.realname}</td>
        <td><a href="javascript:open('{:url("user/show",array("username"=>$vo["username"]))}','查看用户信息');" >{$vo.username}</a></td>

        <td>{if $vo.create_time}{$vo.create_time|date="Y-m-d H:i:s"}{else}<p style="text-align:center">--</p>{/if}</td>
        <td>{if $vo.audit_time}{$vo.audit_time|date="Y-m-d H:i:s"}{else}<p style="text-align:center">--</p>{/if}</td>
        <td>{if $vo.editor}{$vo.editor}{else}<p style="text-align:center">--</p>{/if}</td>
        <td>{if $vo.status == 0}<span class="layui-badge layui-bg-gray">待审核</span>{elseif $vo.status==1 }<span class="layui-badge layui-bg-blue">成功</span>
        {elseif $vo.status== 2 }<span class="layui-badge">失败</span>
        {/if}</td>
        <td><div class="layui-btn-group">
        {if $vo.status ==0}
          <button class="layui-btn layui-btn-normal layui-btn-xs confirm" data-id="{$vo.id}" data-status="1"  style="margin-bottom:10px;margin-right:5px !important;">
            <i class="layui-icon layui-icon-ok-circle"></i>确认已打款
          </button>

          <button class="layui-btn layui-btn-normal layui-btn-xs refuse" data-id="{$vo.id}" data-status="2"  style="margin-bottom:10px;margin-right:5px !important;">
            <i class="layui-icon layui-icon-close "></i>拒绝
          </button>
        {/if}
        {if $vo.status !=0}
          <button class="layui-btn  layui-btn-primary layui-btn-xs" onclick="del('{:url("financeWithdraw/del",array("id"=>$vo["id"]))}')"  style="margin-bottom:10px">
            <i class="layui-icon layui-icon-delete"></i>删除
          </button>
        {/if}
        </div>
      </td>
      </tr>
{/volist}

    </tbody>
  </table>
<!-- 搜索为空显示 -->
{if empty($list)}
 <div class="layui-form-item">
    <div class="empty">
     <div class="img"></div>
     <p>暂无内容</p></div>
 </div>
</div>
{/if}


</div>

<div id="pages">{$page|raw}</div>

<div class="layui-btn-group demoTable">
  <button class="layui-btn layui-btn-primary" id="del" data-type="getCheckData"> <i class="layui-icon">&#xe640;</i> 批量删除</button>
</div>


<script>
$(function(){
 //全选批量删除
        var id = []; //定义空数组
        var url ="{:url('financeWithdraw/del')}"; //请求的url
        var data = {"id":id};   //传递的表单数据
        var delButton = "#del"; //删除节点class 或者ID
        var checkboxClass = ".id"; //多选框class
       

         $(delButton).click(function(){
              $(checkboxClass).each(function() {
              if(this.checked == true){
                   id.push($(this).val()); 
              }
              });              
         if(id.length == 0){
            parent.layer.alert('你没有选中任何分类',{title:'批量删除提示'});
         }else{
                     var index =parent.layer.confirm('批量删除后，数据不可恢复', {
                      btn: ['确定删除','取消'] //按钮
                      ,title:'是否批量删除'
                      ,shadeClose:true
                      ,icon: 3
                      ,anim: 5  //动画类型
                    }, function(){
                      parent.layer.close(index);
                    // 确定ajax 删除数据
                                $.post(url,data        
                                     ,function(json){
                                      if(json.code == 0){
                                          layer.msg(json.msg);
                                               setTimeout(function(){ 
                                                     window.location.reload();  //页面刷新
                                                },1000);
                                           }
                                         }
                                       );

                    }, function(){
                       // 取消

                    });

         }

    });



//通过审核
$(".confirm").on("click",function(){
  var id =  $(this).attr('data-id');
   parent.layer.confirm('平台是否已经打款', {
      btn: ['已经打款','取消'] //按钮
      ,title:false
      }, function(){
            $.post("{:url('financeWithdraw/audit')}",{"id":id,"status":1},function(json){
              if(json.code == 0){
                parent.layer.msg(json.msg);
                 setTimeout(function(){ 
                           window.location.reload();  //页面刷新
                           },1000);
              }           
           });  
    
      }, function(){

      });

});
//拒绝 
$(".refuse").on("click",function(){
  var id =  $(this).attr('data-id');
   parent.layer.confirm('您确定拒绝用户的提现申请吗', {
      btn: ['确定','取消'] //按钮
      ,title:false
      }, function(){
            $.post("{:url('financeWithdraw/audit')}",{"id":id,"status":2},function(json){
              if(json.code == 0){
                parent.layer.msg(json.msg);
                 setTimeout(function(){ 
                           window.location.reload();  //页面刷新
                           },1000);
              }           
           });  
    
      }, function(){

      });
 

});


});
</script>
</body>

</html>